package api

import (
	"gitee.com/go-course/go12/devcloud-mini/cmdb/apps/resource"
	"github.com/infraboard/mcube/ioc"
)

func init() {
	ioc.Api().Registry(&handler{})
}

// Gin ---> GoRestful

type handler struct {
	ioc.ObjectImpl
	Svc resource.Service
}

func (h *handler) Init() error {
	h.Svc = ioc.Controller().Get(resource.AppName).(resource.Service)
	return nil
}

func (h *handler) Name() string {
	return resource.AppName
}
